<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta name="author" content="yinq">
<title>首页 - hean校风云系统</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<link rel="stylesheet" type="text/css" th:href="@{css/materialdesignicons.min.css}">
<link rel="stylesheet" type="text/css" th:href="@{css/bootstrap.min.css}">
<link rel="stylesheet" type="text/css" th:href="@{css/animate.min.css}">
<link rel="stylesheet" type="text/css" th:href="@{css/style.min.css}">

</head>
<body>
<div th:include="comm/comm.html"></div>
    <!--页面主要内容-->
    <main class="lyear-layout-content">
      
      <div class="container-fluid p-t-15">
  
        <div class="row">
          <div class="col-md-6 col-xl-3">
            <div class="card bg-primary text-white">
              <div class="card-body clearfix">
                <div class="flex-box">
                  <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-currency-cny fs-22"></i></span>
                  <span class="fs-22 lh-22">83532</span>
                </div>
                <div class="text-right">校区本月营业额</div>
              </div>
            </div>
          </div>
          
          <div class="col-md-6 col-xl-3">
            <div class="card bg-danger text-white">
              <div class="card-body clearfix">
                <div class="flex-box">
                  <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-account fs-22"></i></span>
                  <span class="fs-22 lh-22">90</span>
                </div>
                <div class="text-right">学生人数</div>
              </div>
            </div>
          </div>
          
          <div class="col-md-6 col-xl-3">
            <div class="card bg-success text-white">
              <div class="card-body clearfix">
                <div class="flex-box">
                  <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-arrow-down-bold fs-22"></i></span>
                  <span class="fs-22 lh-22">3</span>
                </div>
                <div class="text-right">今日请假人数</div>
              </div>
            </div>
          </div>
          
          <div class="col-md-6 col-xl-3">
            <div class="card bg-purple text-white">
              <div class="card-body clearfix">
                <div class="flex-box">
                  <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-comment-outline fs-22"></i></span>
                  <span class="fs-22 lh-22">8</span>
                </div>
                <div class="text-right">本区教师人数</div>
              </div>
            </div>
          </div>
        </div>
        
        <div class="row">
          
          <div class="col-md-6"> 
            <div class="card">
              <div class="card-header">
                <div class="card-title">本月绩效</div>
              </div>
              <div class="card-body" id="container">
              </div>
            </div>
          </div>
          
          <div class="col-md-6"> 
            <div class="card">
              <div class="card-header">
                <div class="card-title">交易历史记录</div>
              </div>
              <div class="card-body">
                <canvas class="js-chartjs-lines"></canvas>
              </div>
            </div>
          </div>
           
        </div>
        

        </div>
        
      </div>
      
    </main>
    <!--End 页面主要内容-->
  </div>
</div>

<script type="text/javascript" th:src="@{js/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{js/popper.min.js}"></script>
<script type="text/javascript" th:src="@{js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{js/perfect-scrollbar.min.js}"></script>
<script type="text/javascript" th:src="@{js/jquery.cookie.min.js}"></script>
<script type="text/javascript" th:src="@{js/main.min.js}"></script>
<script type="text/javascript" th:src="@{/js/echarts.js}"></script>
<script type="text/javascript">


  $(function f() {
    var dom = document.getElementById("container");
    console.log(dom)
    var myChart = echarts.init(dom);
    var app = {};
    var option;

    // 获取统计内容
    $.post("findAllAch?month="+8,function (r) {
      if (r==""){
        alert("暂无此月份数据！")
      }
      var x_data = [];
      for (let i = 0; i < r.length; i++) {
        x_data.push(r[i].tname)
      }
      var y_data = [];
      for (let i = 0; i < r.length; i++) {
        y_data.push(r[i].achievements)
      }

      option = {
        title: {
          text: '公司'+8+'月份绩效',
          subtext: '真实有效',
          left: 'center'
        },
        xAxis: {
          type: 'category',
          data: x_data
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: y_data,
            type: 'bar',
            itemStyle: {
              normal: {
                label: {
                  show: true, //开启显示
                  position: 'top', //在上方显示
                  textStyle: { //数值样式
                    color: 'black',
                    fontSize: 16
                  }
                }
              }
            },
          }
        ]
      };
      if (option && typeof option === 'object') {
        myChart.setOption(option);
      }
    })
  })
</script>
</body>
</html>